<!DOCTYPE html>
<html>

<head>
  <title>Quarkus Runtime Performance</title>
  <script id="adobe_dtm" src="https://www.redhat.com/dtm.js" type="text/javascript"></script>
  <script src="/assets/javascript/highlight.pack.js" type="text/javascript"></script>
  <META HTTP-EQUIV='Content-Security-Policy' CONTENT="default-src 'none'; script-src 'self' 'unsafe-eval' 'sha256-ANpuoVzuSex6VhqpYgsG25OHWVA1I+F6aGU04LoI+5s=' 'sha256-ipy9P/3rZZW06mTLAR0EnXvxSNcnfSDPLDuh3kzbB1w=' js.bizographics.com https://www.redhat.com assets.adobedtm.com jsonip.com https://ajax.googleapis.com https://www.googletagmanager.com https://www.google-analytics.com https://use.fontawesome.com; style-src 'self' https://fonts.googleapis.com https://use.fontawesome.com; img-src 'self' *; media-src 'self' ; frame-src https://www.googletagmanager.com https://www.youtube.com; frame-ancestors 'none'; base-uri 'none'; object-src 'none'; form-action 'none'; font-src 'self' https://use.fontawesome.com https://fonts.gstatic.com;">
  <META HTTP-EQUIV='X-Frame-Options' CONTENT="DENY">
  <META HTTP-EQUIV='X-XSS-Protection' CONTENT="1; mode=block">
  <META HTTP-EQUIV='X-Content-Type-Options' CONTENT="nosniff">
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="Quarkus: Supersonic Subatomic Java">
  <meta name="twitter:card" content="summary_large_image">
  <meta name="twitter:site" content="@QuarkusIO"> 
  <meta name="twitter:creator" content="@QuarkusIO">
  <meta property="og:url" content="https://quarkus.io/blog/runtime-performance/" />
  <meta property="og:title" content="Quarkus Runtime Performance" />
  <meta property="og:description" content="Quarkus: Supersonic Subatomic Java" />
  <meta property="og:image" content="/assets/images/quarkus_card.png" />
  <link rel="canonical" href="https://quarkus.io/blog/runtime-performance/">
  <link rel="shortcut icon" type="image/png" href="/favicon.ico" >
  <link rel="stylesheet" href="https://quarkus.io/guides/stylesheet/config.css" />
  <link rel="stylesheet" href="/assets/css/main.css" />
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
  <link rel="alternate" type="application/rss+xml"  href="https://quarkus.io/feed.xml" title="Quarkus">
  <script src="https://quarkus.io/assets/javascript/goan.js" type="text/javascript"></script>
  <script src="https://quarkus.io/assets/javascript/hl.js" type="text/javascript"></script>
</head>

<body class="post">
  <!-- Google Tag Manager (noscript) -->
  <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NJWS5L"
  height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
  <!-- End Google Tag Manager (noscript) -->

  <div class="nav-wrapper">
  <div class="grid-wrapper">
    <div class="width-12-12">
      <input type="checkbox" id="checkbox" />
      <nav id="main-nav" class="main-nav">
  <div class="container">
    <div class="logo-wrapper">
      
        <a href="/"><img src="/assets/images/quarkus_logo_horizontal_rgb_600px_reverse.png" class="project-logo" title="Quarkus"></a>
      
    </div>
    <label class="nav-toggle" for="checkbox">
      <i class="fa fa-bars"></i>
    </label>
    <div id="menu" class="menu">
      <span>
        <a href="/get-started/" class="">Get Started</a>
      </span>
      <span>
        <a href="/guides/" class="">Guides</a>
      </span>
      <span>
        <a href="/community/" class="">Community</a>
      </span>
      <span>
        <a href="/support/" class="">Support</a>
      </span>
      <span>
        <a href="/blog/" class="active">Blog</a>
      </span>
      <span>
        <a href="https://code.quarkus.io" class="button-cta secondary white">Start Coding</a>
      </span>
    </div>
  </div>
      </nav>
    </div>
  </div>
</div>

  <div class="content">
    <div class="post-page grid-wrapper">
  <div class="width-8-12 width-12-12-m doc-content">
    <div class="grid-wrapper">
      <div class="width-12-12">
        <p>
          <a href="/blog"><i class="fas fa-angle-left"></i> Back to all posts</a>
        </p>
      </div>
      <div class="width-12-12">
        <div class="post-date">
          July 07, 2019 
          
            <span class="tags"><a href="/blog/tag/performance">#performance</a></span>
          
        </div>
        <h1 class="post-title">Quarkus Runtime Performance</h1>
        <div class="grid-wrapper">
          <div class="width-8-12 width-12-12-m byline-wrapper">
            
            
              <img class="headshot" src="https://www.gravatar.com/avatar/2af18d6d315c1bd0a07aeda14e30ff72">
            
            <p class="byline">By John O'Hara</p>
          </div>
          <div class="width-12-12">
              <div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>This the first part of a blog series that delves deeper into Quarkus performance.  There are many aspects to the performance of a framework from bootstrap time to memory usage, compile time and runtime performance.</p>
</div>
<div class="paragraph">
<p>The definition of <em>"performance"</em> is contextual and these series of blog posts aims to investigate the performance of Quarkus in varying contexts.</p>
</div>
<div class="paragraph">
<p>This article will focus on <strong>runtime performance</strong> of applications built with Quarkus.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="tldr-summary"><a class="anchor" href="#tldr-summary"></a>tl;dr - Summary</h2>
<div class="sectionbody">
<div class="paragraph">
<p>A REST application that retrieves data from a postgres database using transactions was created to compare the throughput and response latencies of Quarkus and Thorntail.  The application was put under varying degrees of load, to demonstrate how Quarkus scales.</p>
</div>
<div class="paragraph">
<p>Quarkus running in native mode, supporting 40 concurrent connections, has shown to provide up to an 38.4% increase in maximum throughput whilst reducing maximum response time latencies by up to 42.7% compared to Thorntail for a single process.</p>
</div>
<div class="paragraph">
<p>Quarkus running in JVM mode, supporting 40 concurrent connections, has shown to provide up to an 136% increase in maximum throughput whilst reducing maximum response time latencies by up to 66.3% compared to Thorntail, for a single process.</p>
</div>
<div class="paragraph">
<p>Quarkus running on the JVM provides improved throughput and response time compared to Native mode for a single process, but uses up to 277% more memory (RSS).</p>
</div>
<div class="paragraph">
<p>For applications running in containers, constrained to 2048MB of RAM, it is theoretically possible to improve application throughput by up to <strong>177.3%</strong> by running multiple instances of a Quarkus application in JVM mode, or <strong>545%</strong> running multiple Quarkus instances in Native mode, compared to a Thorntail application.</p>
</div>
<div class="paragraph">
<p>Native images are <strong>not just</strong> for short running processes. The tests ran for up to 3 hours, without process restarts, and the native image served over <strong>33 MILLION</strong> requests!</p>
</div>
<div class="paragraph">
<p><strong>One size does not fit all! Quarkus gives you the option to scale up in JVM mode if you need a single instance with a larger heap, or scale out in Native mode if you need more, lighter-weight instances</strong></p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="elephant-in-the-room"><a class="anchor" href="#elephant-in-the-room"></a>Elephant in the Room</h2>
<div class="sectionbody">
<div class="paragraph">
<p><strong>"It&#8217;s all well and good optimizing for bootstrap start-up times and image size, but response time is still important"</strong>.</p>
</div>
<div class="paragraph">
<p>Let us first address the elephant in the room, Quarkus has so far been focused on start-up time and Memory Footprint.</p>
</div>
<div class="paragraph">
<p><strong>"That&#8217;s because native performance sucks right?!"</strong> <em>Wrong!</em></p>
</div>
<div class="paragraph">
<p>By running a sample application, retrieving data from a PostgreSQL database via transactional REST HTTP requests, I will address</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Single process Throughput and Reponse Time in Native mode and JVM mode, compared to Thorntail</p>
</li>
<li>
<p>Native images for long running processes</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Details of the application and test methodology can be found at the end of this post in the <a href="#test-application">Test Application</a> section.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="what-does-quarkus-give-you"><a class="anchor" href="#what-does-quarkus-give-you"></a>What does Quarkus give you?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Quarkus provides you with a choice of 2 run modes.  You can either run as a native binary <strong>or</strong> as bytecode on a JVM.</p>
</div>
<div class="paragraph">
<p>That means you can choose the runtime that meets <strong>your</strong> needs for <strong>your</strong> application. If a native image doesn&#8217;t give you what you need, no problem, choose your favourite JVM.</p>
</div>
<div class="paragraph">
<p>But don&#8217;t think that running on the JVM is a second rate citizen, Quarkus is optimized for running on the JVM as well as in native mode</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="why-compare-with-thorntail"><a class="anchor" href="#why-compare-with-thorntail"></a>Why compare with Thorntail?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Thorntail is a more traditional cloud-native stack that has its base from the WildFly community and we decided that it&#8217;s fair to compare with a runtime that we know how to optimize. The point of this performance test is not to compare frameworks vs framework, but to show that the optimizations done in Quarkus goes beyond just startup time and initial memory consumption. Thorntail is a great runtime, but just like other traditional cloud-native stacks the runtime dynamics behavior that wasn&#8217;t a concern on a standalone deployment is turning out to be a cause of significant overhead for modern deployment scenarios.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="throughput-reqsec"><a class="anchor" href="#throughput-reqsec"></a>Throughput (Req/Sec)</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Maximum throughput, measured in requests per second (Req/Sec) tells us the maximum number of request the single process application can service per second.  The higher the maximum throughput, the better.</p>
</div>
<div class="paragraph">
<p>Comparing a native Quarkus application to Thorntail running on a JVM, the maximum throughput is consistent as the number of concurrent users increases.</p>
</div>
<div class="admonitionblock important">
<table>
<tr>
<td class="icon">
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
<div class="paragraph">
<p><strong>Quarkus 0.18.0, running a single instance in Native mode with 40 concurrent connections, provides a 38.4% increase in maximum throughput compared to Thorntail 2.4.0.Final running on the JVM</strong>.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="admonitionblock important">
<table>
<tr>
<td class="icon">
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
<div class="paragraph">
<p><strong>Quarkus 0.18.0, running a single instance in JVM mode with 40 concurrent connections, out-performs Thorntail 2.4.0.Final by 136%</strong>.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p> </p>
</div>
<div class="imageblock">
<div class="content">
<img src="/assets/images/posts/performance/throughput.png" alt="Throughput as a function of concurrent users">
</div>
<div class="title">Figure 1. Maximum throughput (req/sec) as a function of concurrent users</div>
</div>
<div class="paragraph">
<p> </p>
</div>
<table class="tableblock frame-topbot grid-all stretch">
<caption class="title">Table 1. Maximum Throughput (Req/Sec)</caption>
<colgroup>
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Concurrent Connections</th>
<th class="tableblock halign-left valign-top">Thorntail</th>
<th class="tableblock halign-left valign-top">Quarkus - Native</th>
<th class="tableblock halign-left valign-top">Quarkus - JVM</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">1</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">3,273</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">3,316</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">5,138</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">5</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">14,092</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">14,998</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">24,417</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">10</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">25,512</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">26,328</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">44,196</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">15</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">31,855</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">33,389</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">59,007</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">20</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">35,006</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">36,515</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">69,146</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">25</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">37,082</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">38,416</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">73,790</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">30</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">33,369</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">38,849</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">76,992</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">35</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">32,974</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">41,691</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">77,118</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">40</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">32,391</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">44,841</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">76,488</p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect1">
<h2 id="response-times-ms"><a class="anchor" href="#response-times-ms"></a>Response Times (ms)</h2>
<div class="sectionbody">
<div class="paragraph">
<p>I would like to start this section with the statement that <strong>"Everything You Know About Latency Is Wrong"</strong> <sup class="footnote">[<a id="_footnoteref_1" class="footnote" href="#_footnotedef_1" title="View footnote.">1</a>]</sup></p>
</div>
<div class="paragraph">
<p>Response time is a measure of the time it takes for the application to respond to a request. The lower the response time, the better. But mean response time is not the overall picture of application responsiveness.  Maximum response time tells us more about user experience than mean response time.</p>
</div>
<div class="paragraph">
<p>Why is this important?  <strong>Maximum response time tells us the worst case scenario, and between 26-93% of page loads will experience the 99th centile response time <sup class="footnote">[<a id="_footnoteref_2" class="footnote" href="#_footnotedef_2" title="View footnote.">2</a>]</sup>.  Having a super low, super stable maximum response latency increases application responsiveness.</strong></p>
</div>
<div class="paragraph">
<p>Under high numbers of concurrent users; Mean response time for Quarkus in JVM mode is 0.91ms vs 1.69ms for Thorntail. When running in Native mode, mean response time shifts to 2.43ms in exchange for the lower memory utilization.</p>
</div>
<div class="paragraph">
<p>If we look at the Maximum response time; Thorntail took 145.3ms to service at least one request, compared to 65.01ms for Quarkus JVM and 83.27ms for Quarkus Native.</p>
</div>
<div class="admonitionblock important">
<table>
<tr>
<td class="icon">
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
<div class="paragraph">
<p>The maximum response time for Quarkus in native mode is super-stable and up to 42.7% lower than Thorntail.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="admonitionblock important">
<table>
<tr>
<td class="icon">
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
<div class="paragraph">
<p>The lower mean response time latencies running on the JVM are due to the GC implementations available in the JVM are superior to the GC implementation currently available in GraalVM. Quarkus is currently still a Beta release, and improvements are planned for running in native mode</p>
</div>
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p> </p>
</div>
<div class="imageblock">
<div class="content">
<img src="/assets/images/posts/performance/meanLatency.png" alt="Mean Response Time as a function of concurrent users">
</div>
<div class="title">Figure 2. Mean Response Time (ms) as a function of concurrent users</div>
</div>
<div class="paragraph">
<p> </p>
</div>
<div class="imageblock">
<div class="content">
<img src="/assets/images/posts/performance/maxLatency.png" alt="Mean Response Time as a function of concurrent users">
</div>
<div class="title">Figure 3. Maximum Response Time (ms) as a function of concurrent users</div>
</div>
<div class="paragraph">
<p> </p>
</div>
<table class="tableblock frame-topbot grid-all stretch">
<caption class="title">Table 2. Response Time (ms)</caption>
<colgroup>
<col style="width: 14.2857%;">
<col style="width: 14.2857%;">
<col style="width: 14.2857%;">
<col style="width: 14.2857%;">
<col style="width: 14.2857%;">
<col style="width: 14.2857%;">
<col style="width: 14.2858%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Concurrent Connections</th>
<th class="tableblock halign-left valign-top">Thorntail (mean)</th>
<th class="tableblock halign-left valign-top">Thorntail (max)</th>
<th class="tableblock halign-left valign-top">Quarkus - Native (mean)</th>
<th class="tableblock halign-left valign-top">Quarkus - Native (max)</th>
<th class="tableblock halign-left valign-top">Quarkus - JVM (mean)</th>
<th class="tableblock halign-left valign-top">Quarkus - JVM (max)</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">1</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0.324</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">9.31</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0.327</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">6.13</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0.196</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">9.52</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">5</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0.461</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">13.12</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0.494</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">9.86</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0.232</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">13.85</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">10</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0.53</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">11.3</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0.698</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">14.24</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0.278</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">16.08</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">15</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0.842</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">145.16</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0.91</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">14.86</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0.334</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">18.38</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">20</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1.02</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">134.9</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1.15</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">16.4</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0.389</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">23.7</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">25</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1.2</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">145.3</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1.3</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">16.86</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0.472</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">21.25</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">30</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1.26</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">34.87</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1.69</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">26.52</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0.545</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">83.27</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">35</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1.35</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">30.94</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1.84</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">65.01</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0.78</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">32.9</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">40</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1.69</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">143.49</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">2.43</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">48.37</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0.91</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">63.71</p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect1">
<h2 id="application-start-time"><a class="anchor" href="#application-start-time"></a>Application Start Time</h2>
<div class="sectionbody">
<div class="paragraph">
<p>start-up times and memory usage were measured for each runtime using the method described here <a href="https://quarkus.io/guides/performance-measure" class="bare">https://quarkus.io/guides/performance-measure</a></p>
</div>
<table class="tableblock frame-topbot grid-all" style="width: 50%;">
<colgroup>
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Metric</th>
<th class="tableblock halign-left valign-top">Thorntail</th>
<th class="tableblock halign-left valign-top">Quarkus - Native</th>
<th class="tableblock halign-left valign-top">Quarkus - JVM</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Start Time</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">8764 ms</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">18 ms</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1629 ms</p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect1">
<h2 id="maximum-memory-usage"><a class="anchor" href="#maximum-memory-usage"></a>Maximum Memory Usage</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Memory for each application process was measured with <code>ps</code></p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">$ ps -o rss -p &lt;PID&gt;</code></pre>
</div>
</div>
<div class="paragraph">
<p>The maximum memory usage during the runs was captured.</p>
</div>
<table class="tableblock frame-topbot grid-all" style="width: 50%;">
<colgroup>
<col style="width: 33.3333%;">
<col style="width: 33.3333%;">
<col style="width: 33.3334%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Thorntail</th>
<th class="tableblock halign-left valign-top">Quarkus - JVM</th>
<th class="tableblock halign-left valign-top">Quarkus - Native</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">651 MB</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">414 MB</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">122 MB</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p> </p>
</div>
<div class="admonitionblock important">
<table>
<tr>
<td class="icon">
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
<div class="paragraph">
<p>Compared to Thorntail, Quarkus in native mode used only <strong>18.7%</strong> of memory to service <strong>20.9% more requests</strong> and Quarkus in JVM mode used <strong>63.6%</strong> of memory to service <strong>108.0%</strong> more requests</p>
</div>
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>Therefore, <strong>using a machine with 2048MB of memory</strong>, running more than one process (not constrained by CPU), it should be possible to achieve the following increases in throughput over Thorntail;</p>
</div>
<table class="tableblock frame-topbot grid-all stretch">
<colgroup>
<col style="width: 16.6666%;">
<col style="width: 16.6666%;">
<col style="width: 16.6666%;">
<col style="width: 16.6666%;">
<col style="width: 16.6666%;">
<col style="width: 16.667%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Runtime Mode</th>
<th class="tableblock halign-left valign-top">Memory (MB)</th>
<th class="tableblock halign-left valign-top">Number processes per 2048MB</th>
<th class="tableblock halign-left valign-top">Max Throughput per Process (Req/Sec)</th>
<th class="tableblock halign-left valign-top">Overall Max Throughput (Req/Sec)</th>
<th class="tableblock halign-left valign-top">Compared to Thorntail</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Thorntail</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">651</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">3</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">37,082</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">111,246</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">100%</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Quarkus - JVM</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">414</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">4</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">77,118</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">308,472</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">277%</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Quarkus - Native</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">122</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">16</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">44,841</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">717,456</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">645%</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p> </p>
</div>
<div class="admonitionblock important">
<table>
<tr>
<td class="icon">
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
<div class="paragraph">
<p>For applications running in cloud environments, it is theoretically possible to improve application throughput by up to <strong>545%</strong> for the same amount of memory by running multiple instances of a Quarkus application in native mode.</p>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="quarkus-native-long-running-processes"><a class="anchor" href="#quarkus-native-long-running-processes"></a>Quarkus native - Long running processes</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Another concern is that Quarkus running in native mode is not suitable for long running processes.</p>
</div>
<div class="admonitionblock important">
<table>
<tr>
<td class="icon">
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
<div class="paragraph">
<p>During testing, Quarkus was running in native mode for more than 3hrs at a time, and serviced over <strong>51,890,000</strong> requests!</p>
</div>
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>These requests caused hundreds of Full GC cycles, and the process remained stable throughout.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="test-application"><a class="anchor" href="#test-application"></a>Test Application</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The test application is a Transactional REST/JPA application that makes calls to a PostgreSQL database. The application and database were both running inside a Docker container.</p>
</div>
<div class="paragraph">
<p>Sources are available here: <a href="https://github.com/johnaohara/quarkusRestCrudDemo" class="bare">https://github.com/johnaohara/quarkusRestCrudDemo</a></p>
</div>
<div class="sect2">
<h3 id="building-and-running-test-application"><a class="anchor" href="#building-and-running-test-application"></a>Building and Running test Application</h3>
<div class="sect3">
<h4 id="prerequisites"><a class="anchor" href="#prerequisites"></a>Prerequisites</h4>
<div class="ulist">
<ul>
<li>
<p>Docker (min v1.13.1)</p>
</li>
<li>
<p>Maven (min 3v.5.4)</p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<h4 id="build"><a class="anchor" href="#build"></a>Build;</h4>
<div class="paragraph">
<p>Quarkus JVM</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs"> $ cd ./quarkus
 $ build-quarkus-jvm.sh</code></pre>
</div>
</div>
<div class="paragraph">
<p>or Quarkus Native</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs"> $ cd ./quarkus
 $ build-quarkus-native.sh</code></pre>
</div>
</div>
<div class="paragraph">
<p>or Thorntail</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs"> $ cd ./thorntail
 $ ./build-thorntail.sh</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="run"><a class="anchor" href="#run"></a>Run;</h4>
<div class="paragraph">
<p>First start PostgreSQL running in a Docker container;</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">docker run -d --rm -p 5432:5432 --network host  \
	-e POSTGRES_DB='rest-crud' \
	-e POSTGRES_USER='restcrud'  \
	-e POSTGRES_PASSWORD='restcrud' \
	docker.io/postgres:10.5</code></pre>
</div>
</div>
<div class="paragraph">
<p>then start the application running in a Docker container;</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs"> $ cd ./quarkus
 $ ./run-quarkus-jvm.sh</code></pre>
</div>
</div>
<div class="paragraph">
<p>or Quarkus Native</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs"> $ run-quarkus-native.sh</code></pre>
</div>
</div>
<div class="paragraph">
<p>or Thorntail</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs"> $ cd ./thorntail
 $ ./run-thorntail.sh</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="runtime-validation"><a class="anchor" href="#runtime-validation"></a>Runtime validation</h4>
<div class="paragraph">
<p>Navigate browser to <a href="http://{REMOTE_HOST}:8080/" class="bare">http://{REMOTE_HOST}:8080/</a></p>
</div>
<div class="paragraph">
<p>or</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">$ curl -D - http://{REMOTE_HOST}:8080/fruits

HTTP/1.1 200 OK
Connection: keep-alive
Content-Type: application/json
Content-Length: 75
Date: Mon, 01 Apr 2019 07:57:17 GMT

[{"id":2,"name":"Apple"},{"id":3,"name":"Banana"},{"id":1,"name":"Cherry"}]</code></pre>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="runtime-performance-metrics"><a class="anchor" href="#runtime-performance-metrics"></a>Runtime Performance Metrics</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Throughput and Response Time were measured using the wrk command line tool <a href="https://github.com/wg/wrk" class="bare">https://github.com/wg/wrk</a>.</p>
</div>
<div class="paragraph">
<p>A shell script for running wrk is provided;</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">$ ./runWrk.sh</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="runtime-environment"><a class="anchor" href="#runtime-environment"></a>Runtime Environment</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="system-under-test"><a class="anchor" href="#system-under-test"></a>System Under Test</h3>
<div class="paragraph">
<p>CPU: 32 x Intel&#174; Xeon&#174; CPU E5-2640 v3 @ 2.60GHz</p>
</div>
<div class="paragraph">
<p>Operating System: Red Hat Enterprise Linux Server release 7.6 (3.10.0-693.25.2.el7.x86_64)</p>
</div>
<div class="paragraph">
<p>Memory: 262GB</p>
</div>
<div class="paragraph">
<p>Ethernet: Solarflare Communications SFC9020 10G Ethernet Controller</p>
</div>
</div>
<div class="sect2">
<h3 id="client-system"><a class="anchor" href="#client-system"></a>Client system</h3>
<div class="paragraph">
<p>CPU: 24 x Intel&#174; Xeon&#174; CPU E5-2640 @ 2.80GHz</p>
</div>
<div class="paragraph">
<p>Operating System: Red Hat Enterprise Linux Server release 7.6 (3.10.0-229.el7.x86_64)</p>
</div>
<div class="paragraph">
<p>Memory: 64GB</p>
</div>
<div class="paragraph">
<p>Ethernet: Solarflare Communications SFC9020 [Solarstorm]</p>
</div>
</div>
<div class="sect2">
<h3 id="jvm"><a class="anchor" href="#jvm"></a>JVM</h3>
<div class="paragraph">
<p>Java HotSpot&#8482; 64-Bit Server VM (build 25.191-b12, mixed mode)</p>
</div>
</div>
</div>
</div>
<div id="footnotes">
<hr>
<div class="footnote" id="_footnotedef_1">
<a href="#_footnoteref_1">1</a>. <a href="https://bravenewgeek.com/everything-you-know-about-latency-is-wrong/" class="bare">https://bravenewgeek.com/everything-you-know-about-latency-is-wrong/</a>
</div>
<div class="footnote" id="_footnotedef_2">
<a href="#_footnoteref_2">2</a>. <a href="https://bravenewgeek.com/everything-you-know-about-latency-is-wrong/" class="bare">https://bravenewgeek.com/everything-you-know-about-latency-is-wrong/</a>
</div>
</div>
              
          </div>
          <div class="width-12-12"><div class="share-page">
  <a class="share-linkedin" href="https://www.linkedin.com/shareArticle?mini=true&url=https://quarkus.io/blog/runtime-performance/&title=Quarkus Runtime Performance" rel="nofollow" target="_blank" title="Share on LinkedIn">
    <img src="/assets/images/share-page/icons_social-linkedin.png"/>
  </a>
  <a class="share-twitter" href="https://twitter.com/intent/tweet?text=Quarkus Runtime Performance&url=https://quarkus.io/blog/runtime-performance/&via=quarkusio&related=quarkusio" rel="nofollow" target="_blank" title="Share on Twitter">
    <img src="/assets/images/share-page/icons_social-twitter.png"/>
  </a>
  <a class="share-facebook" href="https://facebook.com/sharer.php?u=https://quarkus.io/blog/runtime-performance/" rel="nofollow" target="_blank" title="Share on Facebook">
    <img src="/assets/images/share-page/icons_social-facebook.png"/>
  </a>
  <a class="share-reddit" href="http://www.reddit.com/submit?url=https://quarkus.io/blog/runtime-performance/" onclick="window.open(this.href, 'pop-up', 'left=20,top=20,width=900,height=500,toolbar=1,resizable=0'); return false;" title="Share on Reddit" >
    <img src="/assets/images/share-page/icons_social-reddit.png"/>
  </a>
  <a class="share-email" href="mailto:?subject=Quarkus Runtime Performance&amp;body=Quarkus Runtime Performance https://quarkus.io/blog/runtime-performance/" title="Share via Email" >
    <img src="/assets/images/share-page/icons_social-email.png"/>
  </a>
</div>
</div>
        </div>
      </div>
    </div>
  </div>
</div>

  </div>

  <div class="content project-footer">
  <div class="footer-section">
    <div class="logo-wrapper">
      <a href="/"><img src="/assets/images/quarkus_logo_horizontal_rgb_reverse.svg" class="project-logo" title="Quarkus"></a>
    </div>
  </div>
  <div class="grid-wrapper">
    <p class="grid__item width-3-12">Quarkus is open. All dependencies of this project are available under the <a href='https://www.apache.org/licenses/LICENSE-2.0' target='_blank'>Apache Software License 2.0</a> or compatible license.<br /><br />This website was built with <a href='https://jekyllrb.com/' target='_blank'>Jekyll</a>, is hosted on <a href='https://pages.github.com/' target='_blank'>Github Pages</a> and is completely open source. If you want to make it better, <a href='https://github.com/quarkusio/quarkusio.github.io' target='_blank'>fork the website</a> and show us what you’ve got.</p>

    
      <div class="width-1-12 project-links">
        <span>Navigation</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="/">Home</a></li>
          
            <li><a href="/guides">Guides</a></li>
          
            <li><a href="/community/#contributing">Contribute</a></li>
          
            <li><a href="/faq">FAQ</a></li>
          
            <li><a href="/get-started">Get Started</a></li>
          
        </ul>
      </div>
    
      <div class="width-1-12 project-links">
        <span>Contribute</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="https://twitter.com/quarkusio">Follow us</a></li>
          
            <li><a href="https://github.com/quarkusio">GitHub</a></li>
          
            <li><a href="/security">Security&nbsp;policy</a></li>
          
        </ul>
      </div>
    
      <div class="width-1-12 project-links">
        <span>Get Help</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="https://groups.google.com/forum/#!forum/quarkus-dev">Forums</a></li>
          
            <li><a href="https://quarkusio.zulipchat.com">Chatroom</a></li>
          
        </ul>
      </div>
    

    
      <div class="width-3-12 more-links">
        <span>Quarkus is made of community projects</span>
        <ul class="footer-links">
          
            <li><a href="https://vertx.io/" target="_blank">Eclipse Vert.x</a></li>
          
            <li><a href="https://microprofile.io" target="_blank">Eclipse MicroProfile</a></li>
          
            <li><a href="https://hibernate.org" target="_blank">Hibernate</a></li>
          
            <li><a href="https://netty.io" target="_blank">Netty</a></li>
          
            <li><a href="https://resteasy.github.io" target="_blank">RESTEasy</a></li>
          
            <li><a href="https://camel.apache.org" target="_blank">Apache Camel</a></li>
          
            <li><a href="https://code.quarkus.io/" target="_blank">And many more...</a></li>
          
        </ul>
      </div>
    
  </div>
</div>
  <div class="content redhat-footer">
  <div class="grid-wrapper">
    <span class="licence">
      <i class="fab fa-creative-commons"></i><i class="fab fa-creative-commons-by"></i> <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC by 3.0</a> | <a href="https://www.redhat.com/en/about/privacy-policy">Privacy Policy</a>
    </span>
    <span class="redhat">
      Sponsored by
    </span>
    <span class="redhat-logo">
      <a href="https://www.redhat.com/" target="_blank"><img src="/assets/images/redhat_reversed.svg"></a>
    </span>
  </div>
</div>


  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js" integrity="sha384-8gBf6Y4YYq7Jx97PIqmTwLPin4hxIzQw5aDmUg/DDhul9fFpbbLcLh3nTIIDJKhx" crossorigin="anonymous"></script>
  <script type="text/javascript" src="/assets/javascript/mobile-nav.js"></script>
  <script type="text/javascript" src="/assets/javascript/scroll-down.js"></script>
  <script src="/assets/javascript/satellite.js" type="text/javascript"></script>
  <script src="https://quarkus.io/guides/javascript/config.js" type="text/javascript"></script>
  <script src="/assets/javascript/search-filter.js" type="text/javascript"></script>
  <script src="/assets/javascript/back-to-top.js" type="text/javascript"></script>
</body>

</html>
